import request from '@/utils/request'

// 查询盘点计划列表
export function listCheckPlan(query) {
  return request({
    url: '/crm/checkPlan/list',
    method: 'get',
    params: query
  })
}

// 查询盘点计划列表
export function queryCheckPlan(query) {
  return request({
    url: '/crm/checkPlan/query',
    method: 'get',
    params: query
  })
}


// 查询盘点计划详细
export function getCheckPlan(id) {
  return request({
    url: '/crm/checkPlan/' + id,
    method: 'get'
  })
}

// 新增盘点计划
export function addCheckPlan(data) {
  return request({
    url: '/crm/checkPlan',
    method: 'post',
    data: data
  })
}

// 完成盘点计划
export function finishCheckPlan(id) {
  return request({
    url: '/crm/checkPlan/finish?id='+id,
    method: 'get'
  })
}

// 新增盘点计划
export function approveCheckPlan(data) {
  return request({
    url: '/crm/checkPlan/approve',
    method: 'post',
    data: data
  })
}

// 修改盘点计划
export function updateCheckPlan(data) {
  return request({
    url: '/crm/checkPlan',
    method: 'put',
    data: data
  })
}

// 删除盘点计划
export function delCheckPlan(id) {
  return request({
    url: '/crm/checkPlan/' + id,
    method: 'delete'
  })
}
